using System;
using System.Windows.Input;
using ScriptEase.Shell.Events;



namespace ScriptEase.Shell.Commands
{
    internal class ProjectCloseCommand : ICommand
    {
        private readonly ShellViewModel _viewViewModel;



        public ProjectCloseCommand(ShellViewModel viewViewModel)
        {
            _viewViewModel = viewViewModel;
        }



        public void Execute(object view)
        {
            _viewViewModel.CloseProject();
        }



        public bool CanExecute(object parameter)
        {
            return (_viewViewModel.ProjectLoadStatus == ProjectStatus.Connected || _viewViewModel.ProjectLoadStatus == ProjectStatus.LoadedDisconnected);
        }



        public event EventHandler CanExecuteChanged;
    }
}